package lancamento;

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.text.DecimalFormat;
import java.text.ParseException;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingConstants;

import model.AcertoTableModel;

import javax.swing.border.EmptyBorder;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableColumn;

import principal.JFPrincipal;

import javax.swing.ImageIcon;

import entidade.Acerto;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

@SuppressWarnings("serial")
public class JIFAcerto extends JDialog {

	private JPanel contentPane;
	private JPanel fieldPane;
	private JPanel balacePane;
	private JPanel buttonPane;
	private JScrollPane scrollPane;
	private JTable table;
	private JLabel lbSaldo;
	private JButton btnNovo;
	private JButton btnEditar;
	private JButton btnExcluir;
	private DecimalFormat df;

	public JIFAcerto(JFPrincipal fPrincipal) {
		super(fPrincipal);
		setBounds(100, 100, 520, 308);
		setLocationRelativeTo(this);
		setTitle("Ger\u00EAncia de Acerto");
		setModal(true);
		
		contentPane = new JPanel(new BorderLayout());
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		
		df = new DecimalFormat("###,##0.00");
		
		fieldPane = new JPanel(new BorderLayout());
		contentPane.add(fieldPane, BorderLayout.CENTER);

		scrollPane = new JScrollPane();
		fieldPane.add(scrollPane, BorderLayout.CENTER);

		table = new JTable();
		scrollPane.setViewportView(table);
		
		balacePane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0));
		fieldPane.add(balacePane, BorderLayout.SOUTH);

		lbSaldo = new JLabel("0,00");
		balacePane.add(lbSaldo);
		
		buttonPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 2, 5));
		contentPane.add(buttonPane, BorderLayout.SOUTH);

		btnNovo = new JButton("Novo");
		btnNovo.setIcon(new ImageIcon(JIFAcerto.class.getResource("/img/textfield.png")));
		btnNovo.setContentAreaFilled(false);
		btnNovo.setMnemonic('N');
		btnNovo.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {				
				
			}
		});
		buttonPane.add(btnNovo);

		btnEditar = new JButton("Editar");
		btnEditar.setIcon(new ImageIcon(JIFAcerto.class.getResource("/img/textfield_rename.png")));
		btnEditar.setContentAreaFilled(false);
		btnEditar.setMnemonic('E');
		btnEditar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				
			}
		});
		buttonPane.add(btnEditar);

		btnExcluir = new JButton("Excluir");
		btnExcluir.setIcon(new ImageIcon(JIFAcerto.class.getResource("/img/delete.png")));
		btnExcluir.setContentAreaFilled(false);
		btnExcluir.setMnemonic('x');
		buttonPane.add(btnExcluir);
		
		
	}
	
	
}
